import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2022-09-28
 * Time:10:41
 */
class S implements Comparable<S>{
    String name;
    int age;

    @Override
    public String toString() {
        return "S{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public S(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public int compareTo(S o) {
        if(this.age>o.age){
            return 1;
        } else if (this.age<o.age) {
            return -1;
        }else {
            return 0;
        }
    }
}
class Money implements Cloneable{
    public int money=2;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

class Person implements Cloneable{
    int id;
    public Money m=new Money();
    @Override
    protected Object clone() throws CloneNotSupportedException {
        Person tmp=(Person) super.clone();
        tmp.m=(Money) this.m.clone();
        return tmp;
    }

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                '}';
    }
}
public class Student {
//    public static void main(String[] args) {
//        S[] s=new S[3];
//        s[0]= new S("dsa",23);
//        s[1]=new S("lv",14);
//        s[2]=new S("laifu",34);
//        S a=new S("dad",12);
//        S b=new S("sd",32);
//        if(a.compareTo(b)<1){
//            System.out.println(1);
//        }
//        Arrays.sort(s);
//        System.out.println(Arrays.deepToString(s));
//        System.out.println(Arrays.toString(s));
////        S s1=new S("XiaoMing",21);
////        s1.String();
//    }

    public static void main(String[] args) throws CloneNotSupportedException{

        Person p=new Person();
        p.m.money=123;
        Person p1=(Person) p.clone();

    }
}
